package com.wulis.seckill.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wulis.seckill.business.pojo.SeckillGoodsInfo;

import java.util.Map;

public interface SeckillGoodsInfoService extends IService<SeckillGoodsInfo> {
    /**
     * 保存秒杀数据到redis缓存
     */
    void cacheStock();

    /**
     * 查看缓存秒杀商品数据
     *
     * @param goodsId
     * @return
     */
    Map getCacheStock(Long goodsId);

    /**
     * 秒杀商品
     *
     * @param goodsId
     * @param num
     * @return
     */
    String lightningDeals(Long goodsId, int num);
}
